package com.itheima.controller;

import com.itheima.domain.Student;
import com.itheima.service.StudentService;
import com.itheima.service.impl.StudentServiceImpl;

public class StudentController {
    private StudentService studentService = new StudentServiceImpl();
    //注册功能
    public void addStudent(Student stu) {
        boolean flag =studentService.addStudent(stu);
        if (flag){
            System.out.println("注册成功");
        }else {
            System.out.println("注册失败");
        }
    }

    //查询全部
    public void findAllStudents() {
        studentService.findAllStudents();
    }
    //登录
    public boolean login(Student stu) {
        return studentService.login(stu);
    }

    //登录成功，返回详细信息
    public Student print() {
        return studentService.print();
    }

    //判断账号是否存在
    public boolean judge(String id) {
        return studentService.judge(id);
    }

    //修改
    public boolean updateStudent(Student upstu) {
        return studentService.updateStudent(upstu);
    }

    //删除
    public boolean deleteStudent(String delid) {
        return studentService.deleteStudent(delid);
    }
}
